package com.kaiwukj.android.ufamily.mvp.ui.page.service.property.notice;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.kaiwukj.android.ufamily.R;
import com.kaiwukj.android.ufamily.app.base.review.BaseActivity;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.CommunityNoticeResult;

import me.yokeyword.fragmentation.anim.DefaultHorizontalAnimator;
import me.yokeyword.fragmentation.anim.FragmentAnimator;

import static com.kaiwukj.android.ufamily.app.constant.ARouterUrlKt.CommunityNoticeUrl;


/**
 * Copyright © KaiWu Technology Company
 *
 * @author Haife
 * @job Android Development
 */

@Route(path = CommunityNoticeUrl)
public class CommunityNoticeActivity extends BaseActivity {
    //@BindView(R.id.fl_my_house_container)
    //FrameLayout mFrameLayout;
    @Autowired(name = "EXTRA_KEY_FRAGMENT")
    String fragmentKey;
    @Autowired
    CommunityNoticeResult result;

    @Override
    public int getLayoutId() {
        ARouter.getInstance().inject(this);
        return R.layout.activity_community_notice;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {

    }

    @Override
    public void initData(@Nullable Bundle savedInstanceState) {
        if (fragmentKey.equals("EXTRA_KEY_LIST")) {
            loadRootFragment(R.id.fl_community_notice_container, CommunityNoticeFragment.newInstance());
        } else {
            loadRootFragment(R.id.fl_community_notice_container, CommunityNoticeDetailFragment.newInstance(result));
        }

    }

    @Override
    public FragmentAnimator onCreateFragmentAnimator() {
        return new DefaultHorizontalAnimator();
    }

}
